package com.taiyuan.tongcheng.http;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.kymjs.kjframe.KJHttp;
import org.kymjs.kjframe.http.HttpConfig;
import org.kymjs.kjframe.http.HttpParams;
import org.kymjs.kjframe.utils.CipherUtils;
import org.kymjs.kjframe.utils.DensityUtils;
import org.kymjs.kjframe.utils.KJLoger;
import org.kymjs.kjframe.utils.StringUtils;
import org.kymjs.kjframe.utils.SystemTool;

import android.content.Context;

import cn.jpush.android.api.JPushInterface;

import com.taiyuan.tongcheng.bean.CargoOrderSimple;
import com.taiyuan.tongcheng.bean.CargoPrice;
import com.taiyuan.tongcheng.bean.MovingOrderSimple;
import com.taiyuan.tongcheng.bean.MovingPrice;
import com.taiyuan.tongcheng.db.TcDbHelper;
import com.taiyuan.tongcheng.ui.ExpressActivity;
import com.taiyuan.tongcheng.util.CommonUtil;
import com.taiyuan.tongcheng.util.SharePreferenceUtil;
import com.taiyuan.tongcheng.util.TcUtil;
/**
 * 
* @Description 获取接口访问HttpParams
* @author wzq
* @date 2015-9-1 下午4:46:30
* @update (date)
* @version V1.0
 */
public class HttpParamUtil {
    /**
     * 
    * @Description: 获取预估订单价格参数
    * @param context
    * @param cargoOrderSimple
    * @return
    * @return HttpParams
    * @throws
    * @autour wzq
    * @date 2015-9-17 下午4:43:21
    * @update (date)
     */
	public static HttpParams getCargoForecastPrice(Context context,
			CargoOrderSimple cargoOrderSimple){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.FREIGHT_GET_PRICE));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_ROLE,"1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_RID, TcDbHelper.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_truckTypeId, cargoOrderSimple.getTruckTypeId());
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_serviceDate, cargoOrderSimple.getErviceDate());
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_totalKmNum, cargoOrderSimple.getTotalKiloMeter()+"");
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_extraServiceIds,cargoOrderSimple.getExtraServiceids());
		params.put("middlePlaceCount",cargoOrderSimple.getMiddlePlaceCount());
		return params;
	}
	
	
	
	/**
	 * 
	 * @Description: 获取下发订单参数
	 * @param context
	 * @param cargoSample
	 * @param price
	 * @return
	 * @return HttpParams
	 * @throws
	 * @autour wzq
	 * @date 2015-9-1 下午2:46:15
	 * @update (date)
	 */
	public static HttpParams getMakeExpressOrderParam(Context context,
			CargoOrderSimple cargoSample, CargoPrice price,SharePreferenceUtil sp) {
		HttpParams params = new HttpParams();
		KJLoger.debug("cargoSample.getIsImFalg()",cargoSample.getIsImFalg());
		long time = System.currentTimeMillis();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_MAKE_ORDER));
		params.put("isImFalg",cargoSample.getIsImFalg());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_serviceDate,
				cargoSample.getErviceDate());
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_truckTypeId,
				cargoSample.getTruckTypeId());
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_extraServiceIds,
				cargoSample.getExtraServiceids());
		params.put("note", cargoSample.getNote());
		params.put("payTypeId", cargoSample.getPayTypeId());
		params.put("startPlace", cargoSample.getStartPlace());
		params.put("startLongitude", cargoSample.getStartLongitude() + "");
		params.put("startLatitude", cargoSample.getStartLatitude() + "");
		params.put("startProvince", cargoSample.getStartProvince());

		KJLoger.debug("startCity" + cargoSample.getStartCity());
		KJLoger.debug("startCityCode"+cargoSample.getStartCityCode());
		KJLoger.debug("endCity"+cargoSample.getEndCity());
		KJLoger.debug("startCityCode"+cargoSample.getEndCityCode());
		KJLoger.debug("middlePlaceInfo"+cargoSample.getMiddlePlaceInfo());

		 params.put("startCity",sp.getLocationCity());
		 params.put("startCityCode",sp.getLocationCityCode());
		 params.put("endCity",cargoSample.getEndCity());
		 params.put("endCityCode",cargoSample.getEndCityCode());
		// 测试
//		params.put("startCity", "太原");
//		params.put("startCityCode", "太原");
//		params.put("endCity", "太原");
//		params.put("endCityCode", "太原");
		//
		params.put("endPlace", cargoSample.getEndPlace());
		params.put("endLongitude", cargoSample.getEndLongitude() + "");
		params.put("endLatitude", cargoSample.getEndLatitude() + "");
		params.put("endProvince", cargoSample.getEndProvince());
		params.put("receiver", cargoSample.getReceiver());
		params.put("receiverMobile", cargoSample.getReceiverMobile());
		params.put("middlePlaceInfo", cargoSample.getMiddlePlaceInfo());
		params.put("moneyCardCode", cargoSample.getMoneyCardCode());
		params.put("tm", time + "");
		params.put("totalKmNum", price.getTotalKmNum() + "");
		params.put("startKm", price.getStartKm() + "");
		params.put("unitPrice", price.getUnitPrice() + "");
		params.put("xishu", price.getXishu() + "");
		params.put("startPrice", price.getStartPrice() + "");
		params.put("liChengPrice", price.getLiChengPrice() + "");
		params.put("extraServicePrice", price.getExtraServicePrice() + "");
		params.put("nightServicePrice", price.getNightServicePrice() + "");
		String sign = TcDbHelper.getUser(context).getUid()
				+ TcDbHelper.getUser(context).getToken()
				+ "1"
				+ CommonUtil.getAndroidDeviceUnique(context)
				+ SystemTool.getAppVersionCode(context)
				+ cargoSample.getIsImFalg()
				+ cargoSample.getErviceDate()
				+ cargoSample.getTruckTypeId()
				+ price.getStartKm()
				+ price.getUnitPrice()
				+ price.getXishu()
				+ price.getStartPrice()
				+ price.getLiChengPrice()
				+ price.getExtraServicePrice()
				+ price.getNightServicePrice()
				+ cargoSample.getExtraServiceids()
				+ cargoSample.getStartPlace()
				+ cargoSample.getStartLongitude()
				+ cargoSample.getStartLatitude()
				+ cargoSample.getStartProvince()
//				+ cargoSample.getStartCity()
//				+ cargoSample.getStartCityCode()
				+sp.getLocationCity()
				+sp.getLocationCityCode()
				+ cargoSample.getEndPlace()
				+ cargoSample.getEndLongitude()
				+ cargoSample.getEndLatitude()
				+ cargoSample.getEndProvince()
				+ cargoSample.getEndCity()
				+ cargoSample.getEndCityCode()
				+ price.getTotalKmNum() + cargoSample.getReceiver()
				+ cargoSample.getReceiverMobile()
				+ cargoSample.getMiddlePlaceInfo() + cargoSample.getPayTypeId()
				+ cargoSample.getMoneyCardCode()
				+ time + TcWebservice.signSecretKey;

		params.put("sign", CipherUtils.md5(sign));
		return params;
	}

	/**
	 * 
	 * @Description: 获取取消订单的参数
	 * @param context
	 * @param uReasonId
	 * @param note
	 * @param orderId
	 * @return
	 * @return HttpParams
	 * @throws
	 * @autour wzq
	 * @date 2015-9-1 下午2:47:07
	 * @update (date)
	 */
	public static HttpParams getCancelOrderParams(Context context,
			int uReasonId, String note, String orderId) {
		
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_CANCLE));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("orderId", orderId);
		
		KJLoger.debug("订单orderId"+orderId);
		
		try {
			params.put("note", URLEncoder.encode(note, "UTF-8"));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		params.put("uReasonId", uReasonId);
		return params;

	}
	
	/**
	 * 
	* @Description: 获取取消及时消息的参数
	* @param context
	* @param uReasonId
	* @param note
	* @param msgId
	* @return
	* @return HttpParams
	* @throws
	* @autour Administrator
	* @date 2015-9-4 下午11:16:42 
	* @update (date)
	 */

	public static HttpParams getCancelImMsg(Context context,
			int uReasonId, String note, String msgId) {
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_CANCLE_IM));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("imId", msgId);
		KJLoger.debug("imId="+msgId);
		return params;
	}
	
	
	/**
	 * 
	 * @Description: 叫车两次无响应
	 * @param context
	 * @param imId
	 * @return
	 * @return HttpParams
	 * @throws
	 * @autour wzq
	 * @date 2015-9-1 下午4:00:00
	 * @update (date)
	 */
	public static HttpParams getNoResParams(Context context, String imId) {
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_NO_RESPONSE));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("imId", imId);
		return params;
	}


    /**
     * 
    * @Description: 修改订单
    * @param context
    * @param orderId
    * @return
    * @return HttpParams
    * @throws
    * @autour wzq
    * @date 2015-9-1 下午4:47:05
    * @update (date)
     */
	public static HttpParams getModifyOrderParams(Context context,
			String orderId) {

		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_NO_RESPONSE));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("orderId", orderId);
		return params;
	}
	/**
	 * 
	* @Description: 获取城市信息
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-5 下午4:37:22
	* @update (date)
	 */
	public static HttpParams getSupportCity(Context context){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.APP_SUPPORT));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		return params;
	}
	
	/**
	 * 
	 * @Description: 获取服务器系统配置
	 * @return
	 * @return HttpParams
	 * @throws
	 * @autour wzq
	 * @date 2015-9-5 下午4:37:22
	 * @update (date)
	 */
	
	public static HttpParams getSystemConfig(Context context){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.APP_GETCONFIG));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		return params;
	}
	
	/**
	 * 
	* @Description: 获取确认信息HttpParams
	* @param context
	* @param orderId
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-5 下午4:56:53
	* @update (date)
	 */
	public static HttpParams getConfirmModify(Context context,String orderId){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_UPDATE));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("orderId", orderId);
		return params;
	}
	
	/**
	 * 
	* @Description: 获取货运订单集合HttpParams
	* @param context
	* @param orderState
	* @param pageIndex
	* @param orderBy   desc，升序为asc
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-5 下午5:04:28
	* @update (date)
	 */
	public static HttpParams getCarGoListParams(Context context,int orderState,int pageIndex,String orderBy){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_GET_LIST));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		if(orderState!=10){
			params.put("status",orderState);
		}
		params.put("pageIndex",pageIndex);
		params.put("orderBy",orderBy);
		
		KJLoger.debug("pageIndex"+pageIndex);
		KJLoger.debug("orderBy"+orderBy);
		KJLoger.debug("uid="+TcDbHelper
				.getUser(context).getUid());
		return params;
	}
	
	/**
	 * 
	* @Description: 取整车订单微信支付信息接口  HttpParams
	* @param context   
	* @param orderId   订单ID
	* @param cardCode  优惠劵编号
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-5 下午5:14:34
	* @update (date)
	 */
	public static HttpParams getCarGoPayParams(Context context,String orderId,String cardCode){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_WXPAY));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_ROLE,"1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_RID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("orderId",orderId);
		params.put("cardCode",cardCode);
		
		KJLoger.debug("orderId"+orderId);
		KJLoger.debug("cardCode"+cardCode);
		return params;
	}
	
	/**
	 * 
	* @Description: 获取评价参数
	* @param context
	* @param orderId
	* @param markNote
	* @param score
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-21 上午9:33:54
	* @update (date)
	 */
	public static HttpParams getCarGoMarkParams(Context context,String orderId,String markNote,int score){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_MARK));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("orderId",orderId);
		params.put("score",score+"");
		KJLoger.debug("orderId"+orderId);
		KJLoger.debug("score"+score);
		return params;
	}
			
	/**
	 * 
	* @Description: TODO
	* @param context
	* @param pageIndex pageIndex=XXX：当前页，不填默认取第一页；
	* @param usedFlag  usedFlag=XXX：是否已使用，1为已使用，0为未使用，不填不过滤；
	* @param expireFlag expireFlag=XXX：是否已过期，1为已过期，0为未过期，不填不过滤；
	* @param orderBy orderBy=XXX:按生成时间排序，默认倒序desc，升序为asc，不填默认取倒序desc
	* @return
	* @return HttpParams
	* @throws
	* @autour Administrator
	* @date 2015年9月16日 上午1:37:05 
	* @update (date)
	 */
	public static HttpParams GetCardListParams(Context context,int pageIndex,int usedFlag,int expireFlag,String orderBy){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.GET_CARDLIST));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("pageIndex",pageIndex);
		params.put("usedFlag",usedFlag);
		params.put("expireFlag",expireFlag);
//		params.put("usedFlag","");
//		params.put("expireFlag","");
		params.put("orderBy",orderBy);
		
		KJLoger.debug("expireFlag"+expireFlag);
		KJLoger.debug("usedFlag"+usedFlag);
		KJLoger.debug("orderBy"+orderBy);
		return params;
	}
	

	/**
	 * 
	* @Description: TODO
	* @param context
	* @param orderId
	* @return 用户或者司机获取订单信息
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-21 下午5:27:28
	* @update (date)
	 */
	public static HttpParams getCargoOrderInfoParams(Context context,String orderId){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.FREIGHT_ORDER_DETAIL));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_ROLE, 1);
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_RID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("orderId",orderId);
		return params;
	}
	
	
	
	//=========================================================================================
	//======================搬家业务==================================
	//=========================================================================================
	//=========================================================================================
	
	/**
	 * 
	* @Description: 获取价格
	* @param context
	* @param movingOrderSimple
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-17 下午5:04:36
	* @update (date)
	 */
	public static HttpParams getMovingForecastPrice(Context context,
			MovingOrderSimple movingOrderSimple){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.MOVING_GET_PRICE));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_ROLE,"1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_RID, TcDbHelper.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_truckTypeId, movingOrderSimple.getTruckTypeId());
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_serviceDate, movingOrderSimple.getServiceDate());
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_totalKmNum, movingOrderSimple.getTotalKmNum()+"");
		params.put("extraServiceInfo",movingOrderSimple.getExtraServiceInfo());
		params.put("startIsLift",movingOrderSimple.getStartIsLift());
		params.put("startFloor",movingOrderSimple.getStartFloor());
		params.put("endIsLift",movingOrderSimple.getEndIsLift());
		params.put("endFloor",movingOrderSimple.getEndFloor());
		return params;
	}
	
			
	/**
	 * 
	* @Description: 获取下单params
	* @param context
	* @param movingOrderSimple
	* @param price
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-18 下午1:13:03
	* @update (date)
	 */
			
	public static HttpParams getMakeMovingOrder(Context context,
			MovingOrderSimple movingOrderSimple,MovingPrice  price){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,TcUtil.getApiName(TcWebservice.API.MOVING_MAKE_ORDER));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_serviceDate, movingOrderSimple.getServiceDate());
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_truckTypeId, movingOrderSimple.getTruckTypeId());
		params.put(HTTPFieldConstant.POST_PARAMS_EXPRESS_totalKmNum, movingOrderSimple.getTotalKmNum()+"");
		params.put("extraServiceInfo",movingOrderSimple.getExtraServiceInfo());
		params.put("note",movingOrderSimple.getNote());
		params.put("startPlace",movingOrderSimple.getStartPlace());
		params.put("startLongitude",movingOrderSimple.getStartLongitude()+"");
		params.put("startLatitude",movingOrderSimple.getStartLatitude()+"");
		params.put("startProvince",movingOrderSimple.getStartProvince()+"");
		params.put("startCity",movingOrderSimple.getStartCity());
		params.put("startCityCode",movingOrderSimple.getStartCityCode());
		params.put("endPlace",movingOrderSimple.getEndPlace());
		params.put("endLongitude",movingOrderSimple.getEndLongitude()+"");
		params.put("endLatitude",movingOrderSimple.getEndLatitude()+"");
		params.put("totalKmNum",movingOrderSimple.getTotalKmNum()+"");
		params.put("startKm",price.getStartKm()+"");
		params.put("unitPrice",price.getUnitPrice()+"");
		params.put("xishu",price.getXishu()+"");
		params.put("startPrice",price.getStartPrice()+"");
		params.put("liChengPrice",price.getLiChengPrice()+"");
		params.put("extraServicePrice",price.getExtraServicePrice()+"");
		params.put("nightServicePrice",price.getNightServicePrice()+"");
		params.put("totalFloorPrice",price.getTotalFloorPrice()+"");
		params.put("receiver",movingOrderSimple.getReceiver());
		params.put("receiverMobile",movingOrderSimple.getReceiverMobile());
		params.put("payTypeId",movingOrderSimple.getPayTypeId());
		params.put("endProvince",movingOrderSimple.getEndProvince());
		params.put("endCity",movingOrderSimple.getEndCity());
		params.put("endCityCode",movingOrderSimple.getEndCityCode());
		params.put("startIsLift",movingOrderSimple.getStartIsLift());
		params.put("startFloor",movingOrderSimple.getStartFloor());
		params.put("endIsLift",movingOrderSimple.getEndIsLift());
		params.put("endFloor",movingOrderSimple.getEndFloor());
		params.put("moneyCardCode",movingOrderSimple.getCouponCode());
		long time=System.currentTimeMillis();
		params.put("tm",time+"");
		String sign = TcDbHelper.getUser(context).getUid()
				+ TcDbHelper.getUser(context).getToken()
				+ "1"
				+ CommonUtil.getAndroidDeviceUnique(context)
				+ SystemTool.getAppVersionCode(context)
				+ movingOrderSimple.getServiceDate()
				+ movingOrderSimple.getTruckTypeId()
				+ price.getStartKm()
				+ price.getUnitPrice()
				+ price.getXishu()
				+ price.getStartPrice()
				+ price.getLiChengPrice()
				+ price.getExtraServicePrice()
				+ price.getNightServicePrice()
				+ movingOrderSimple.getExtraServiceInfo()
				+ movingOrderSimple.getStartPlace()
				+ movingOrderSimple.getStartLongitude()
				+ movingOrderSimple.getStartLatitude()
				+ movingOrderSimple.getStartProvince()
				+ movingOrderSimple.getStartCity()
				+ movingOrderSimple.getStartCityCode()
				+ movingOrderSimple.getEndPlace()
				+ movingOrderSimple.getEndLongitude()
				+ movingOrderSimple.getEndLatitude()
				+ movingOrderSimple.getEndProvince()
				+ movingOrderSimple.getEndCity()
				+ movingOrderSimple.getEndCityCode()
				+ movingOrderSimple.getTotalKmNum()
				+ movingOrderSimple.getReceiver()
				+ movingOrderSimple.getReceiverMobile()
				+ movingOrderSimple.getPayTypeId()
				+ price.getTotalFloorPrice()
				+ movingOrderSimple.getStartIsLift()
				+ movingOrderSimple.getStartFloor()
				+ movingOrderSimple.getEndIsLift()
				+ movingOrderSimple.getEndFloor()
				+ movingOrderSimple.getCouponCode()
				+ time + TcWebservice.signSecretKey;
		params.put("sign", CipherUtils.md5(sign));
		return params;
	}
	 
	/**
	 * 
	* @Description: 取消搬家订单
	* @param orderId
	* @param context
	* @param reasonId
	* @param note
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-18 下午2:08:33
	* @update (date)
	 */
	public static HttpParams getMovingOrderCancel(String orderId ,Context context ,int reasonId,String note) {
	    		HttpParams params = new HttpParams();
	    		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.MOVING_ORDER_CANCLE));
	    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper.getUser(context).getUid());
	    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper.getUser(context).getToken());
	    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
	    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
	    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, 1);
	    		params.put("orderId", orderId);
	    		params.put("uReasonId", reasonId);
	    		try {
					params.put("note", URLEncoder.encode(note, "UTF-8"));
				} catch (UnsupportedEncodingException e) {
					e.printStackTrace();
				}
	    		return params;
	}
	
	     /**
	      *   
	     * @Description: 用户或者司机获取搬家订单信息接口
	     * @param context
	     * @param orderId
	     * @return
	     * @return HttpParams
	     * @throws
	     * @autour wzq
	     * @date 2015-9-18 下午1:25:44
	     * @update (date)
	      */
	   	public static HttpParams getMovingOrderInfo(Context context,String orderId ) {
    		HttpParams params = new HttpParams();
    		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.MOVING_ORDER_DETAIL));
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_ROLE,"1");
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_RID, TcDbHelper.getUser(context).getUid());
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper.getUser(context).getToken());
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
    		params.put("orderId", orderId);
    		return params;
        }
	   	
	   	/**
	   	 *   
	   	 * @Description: 司机修改搬家订单后，用户确认
	   	 * @param context
	   	 * @param orderId
	   	 * @return
	   	 * @return HttpParams
	   	 * @throws
	   	 * @autour wzq
	   	 * @date 2015-9-18 下午1:25:44
	   	 * @update (date)
	   	 */
	   	
	   	public static HttpParams getMovingOrderModify(Context context,String orderId ) {
	   		HttpParams params = new HttpParams();
	   		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.MOVING_ORDER_CONFIRM));
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper.getUser(context).getUid());
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper.getUser(context).getToken());
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
	   		params.put("orderId", orderId);
	   		return params;
	   	}
	   	/**
	   	 *   
	   	 * @Description: 用户确认搬家信息完成
	   	 * @param context
	   	 * @param orderId
	   	 * @return
	   	 * @return HttpParams
	   	 * @throws
	   	 * @autour wzq
	   	 * @date 2015-9-18 下午1:25:44
	   	 * @update (date)
	   	 */
	   	
	   	public static HttpParams getMovingOrderComplish(Context context,String orderId ) {
	   		HttpParams params = new HttpParams();
	   		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.MOVING_ORDER_FINISH));
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper.getUser(context).getUid());
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper.getUser(context).getToken());
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
	   		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
	   		params.put("orderId", orderId);
	   		return params;
	   	}
	   	
	   	
	   	/**
	   	 * 		
	   	* @Description: 获取微信支付信息
	   	* @param context
	   	* @param orderId  搬家订单id；
	   	* @param djFlag 是否是支付定金，1为是，0和空为不是
	   	* @return
	   	* @return HttpParams
	   	* @throws
	   	* @autour wzq
	   	* @date 2015-9-18 下午2:45:21
	   	* @update (date)
	   	 */
	   	//用户或者司机在线支付，获取搬家订单支付信息，其中用户付定金也是用这个接口，通过参数来区分是不是付定金
	 	public static HttpParams getMovingWxPay(Context context,String orderId,int djFlag ) {
    		HttpParams params = new HttpParams();
    		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.MOVING_ORDER_WXPAY));
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_ROLE,"1");
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_RID, TcDbHelper.getUser(context).getUid());
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper.getUser(context).getToken());
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
    		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
    		params.put("orderId", orderId);
    		params.put("djFlag", djFlag);
    		return params;
        }
	 	

	 			
	 			
	/**
	 * 
	 * @Description: 获取搬家订单集合HttpParams
	 * @param context
	 * @param orderState
	 * @param pageIndex
	 * @param orderBy
	 *  desc，升序为asc
	 * @return
	 * @return HttpParams
	 * @throws
	 * @autour wzq
	 * @date 2015-9-5 下午5:04:28
	 * @update (date)
	 */
	public static HttpParams getMovingListParams(Context context,
			int orderState, int pageIndex, String orderBy) {
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.MOVING_ORDER_GET_LIST));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		if (orderState != 10) {
			params.put("status", orderState);
		}
		params.put("pageIndex", pageIndex);
		params.put("orderBy", orderBy);

		KJLoger.debug("pageIndex" + pageIndex);
		KJLoger.debug("orderBy" + orderBy);
		KJLoger.debug("uid=" + TcDbHelper.getUser(context).getUid());
		return params;
	}
	
	/**
	 * 
	* @Description: 获取评价参数
	* @param context
	* @param orderId
	* @param markNote
	* @param score
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-21 上午9:33:54
	* @update (date)
	 */
	public static HttpParams getMovingMarkParams(Context context,String orderId,String markNote,int score){
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.MOVING_MAKE_ORDER));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("orderId",orderId);
		params.put("score",score+"");
		return params;
	}
	
	/**
	 * 
	* @Description: 获取司机当前的位置信息
	* @param context
	* @param driverId 该订单的司机id；
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-21 下午12:38:10
	* @update (date)
	 */
	
	public static HttpParams getDriverPosition(Context context,String driverId) {
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.GET_DRIVER_POSITION));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("did",driverId);
		return params;
	}
	
	//===============================================================================================
	//===============================优惠劵======================================================
	//===============================================================================================
	/**
	 * 
	* @Description: 优惠劵兑换
	* @param context
	* @param activeCode
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-21 下午6:14:07
	* @update (date)
	 */
	public static HttpParams getDuihuanCouponParam(Context context,String activeCode) {
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.UBIND_COUPON));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("activeCode", activeCode);
		Long time=System.currentTimeMillis();
		params.put("rad", time+"");
		params.put("tm", time+"");
		String sign=TcDbHelper.getUser(context).getUid()
				+TcDbHelper.getUser(context).getToken()
				+"1"
				+CommonUtil.getAndroidDeviceUnique(context)
				+SystemTool.getAppVersionCode(context)
				+activeCode
				+time
				+time
				+TcWebservice.signSecretKey
				;
		params.put("sign", CipherUtils.md5(sign));
		return params;
	}
	
	//====================================个人中心httpparam=======================================================
	//====================================个人中心httpparam=======================================================
	//====================================个人中心httpparam=======================================================
	/**
	 * 
	* @Description: 短信验证码
	* @param context
	* @param newPwd 新密码
	* @param qrPwd  确认密码
	* @param sms  短信验证码
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-21 下午7:02:31
	* @update (date)
	 */
	public static HttpParams getAccountResetParam(Context context,String mobile,String newPwd,String qrPwd,String sms ) {

		HttpParams params = new HttpParams();
			params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.ACCOUNT_RESET));
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_MOBILE, mobile);
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_SMS, sms);
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_NEWPWD,newPwd);
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_QRPWD,qrPwd);
			long time =System.currentTimeMillis();
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TM, time+"");
			params.put("rad", time+"");
			params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_SIGN, 
					 CipherUtils.md5(
							     mobile
								+"1"
								+CommonUtil.getAndroidDeviceUnique(context)
								+SystemTool.getAppVersionCode(context)
								+sms
								+newPwd
								+qrPwd
								+time
								+time
								+TcWebservice.signSecretKey)
					);
			
			return params;
	}
	
	/**
	 * 
	* @Description: 获取重置密码短信验证码
	* @param context
	* @param mobile
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-21 下午7:18:43
	* @update (date)
	 */
	
	public static HttpParams getAccountResetCodeParam(Context context,String mobile) {

		long time= System.currentTimeMillis();
  		HttpParams params = new HttpParams();
  		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.ACCOUNT_RESET_SMS));
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_MOBILE, mobile);
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TM, time+"");
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_SIGN, 
  				 CipherUtils.md5(mobile
  							+"1"
  							+CommonUtil.getAndroidDeviceUnique(context)
  							+SystemTool.getAppVersionCode(context)
  							+time
  							+TcWebservice.signSecretKey)
  				);
	   return params;
	}
	/**
	 * 
	* @Description: 修改个人信息
	* @param context
	* @param mobile
	* @return
	* @return HttpParams
	* @throws
	* @autour wzq
	* @date 2015-9-24 上午11:35:51
	* @update (date)
	 */
	public static HttpParams getAccountUdpateUserName(Context context,String name){
	      		HttpParams params = new HttpParams();
	      		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.ACCOUNT_UPDATA_NAME));
	      		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper.getUser(context).getUid());
	      		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
	      		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
	      		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
	      		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
	    				.getUser(context).getToken());
	      		try {
					params.put("name",URLEncoder.encode(name, "UTF-8"));
				} catch (UnsupportedEncodingException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
	    	   return params;
	}
	//===============================================================
	//======================获取配置信息===========================
	//===============================================================
	
	public static HttpParams getSystemConfig(Context context,String name){
  		HttpParams params = new HttpParams();
  		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT, TcUtil.getApiName(TcWebservice.API.APP_GETCONFIG));
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID, CommonUtil.getAndroidDeviceUnique(context));
  		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER, SystemTool.getAppVersionCode(context));
	   return params;
}
	
	
/**
 * 
 * @param context
 * @param name
 * @return  获取优惠券
 */
	public static HttpParams getShareGift(Context context) {
		long time = System.currentTimeMillis();
		HttpParams params = new HttpParams();
		params.put(HTTPFieldConstant.POST_PARAMS_COMMON_ACT,
				TcUtil.getApiName(TcWebservice.API.ACCOUNT_GET_SHARE_GIFT));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_UID, TcDbHelper
				.getUser(context).getUid());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TOKEN, TcDbHelper
				.getUser(context).getToken());
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_FROM, "1");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_DEVID,
				CommonUtil.getAndroidDeviceUnique(context));
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_VER,
				SystemTool.getAppVersionCode(context));
		params.put("rad", time + "");
		params.put(HTTPFieldConstant.POST_PARAMS_ACCOUNT_TM, time + "");
		params.put(
				HTTPFieldConstant.POST_PARAMS_ACCOUNT_SIGN,
				CipherUtils.md5(TcDbHelper.getUser(context).getUid()
						+ TcDbHelper.getUser(context).getToken() + "1"
						+ CommonUtil.getAndroidDeviceUnique(context)
						+ SystemTool.getAppVersionCode(context) + time + time
						+ TcWebservice.signSecretKey));
		return params;
	}
}
